import Vue from 'vue';
import VueRouter from 'vue-router';

import Home from '../views/Home';
import Search from '../views/Search';
import Login from '../views/Logiin';
import Register from '../views/Register';

Vue.use(VueRouter);

const routes = [
	{
		path: '/',
		name: 'Home',
		component: Home
	},
	{
		path: '/Home',
		name: 'Home',
		component: Home
	},
	{
		path: '/Search',
		name: 'Search',
		component: Search
	},
	{
		path: '/Login',
		name: 'Login',
		component: Login,

		// meta参数：若当前路由组件被加载了，meta参数就会传入到$route
		meta: {
			isHideFooter: true
		}
	},
	{
		path: '/register',
		name: 'Register',
		component: Register,

		meta: {
			isHideFooter: true
		}
	}
];

// 创建一个VueRouter实例
const router = new VueRouter({
	mode: 'history',
	base: process.env.BASE_URL,
	routes
});

export default router;
